home *** CD-ROM | disk | FTP | other *** search
/ Chip 1996 December / CHIP Aralık 1996.iso / prog / backpack / demodata / dep_dir / shared.dxr / 00923_GoDest.ls < prev    next >
Encoding:
Text File  |  1995-08-30  |  1.5 KB  |  58 lines

  1. on mouseUp
  2.   global EXCF, K5, CASH, F_JOBS, PNM, TWNS, J, CHN, CURR_S, ACTION, YY, MM, DD, F_TRAV, ASKCAST
  3.   set a to integer(Infla(J, CASH / EXCF))
  4.   set b to integer(Infla(J, K5 / EXCF))
  5.   set S to a - b
  6.   set R to getAt(CURR_S, getLast(TWNS))
  7.   set CASH to CASH - K5
  8.   set P to b / 50
  9.   puppetSound("Cash1")
  10.   updateStage()
  11.   set T to the ticks + 60
  12.   repeat while T > the ticks
  13.     set a to a - P
  14.     set the text of field "Money" to string(a) && R
  15.   end repeat
  16.   set the text of field "Money" to string(S) && R
  17.   puppetSound(0)
  18.   set P to value(line 2 of the text of cast ASKCAST)
  19.   append(TWNS, P)
  20.   append(ACTION, PutDate(YY, MM, DD))
  21.   append(ACTION, "D" & P)
  22.   if listp(F_JOBS) then
  23.     set F_JOBS to 0
  24.   end if
  25.   if listp(F_TRAV) then
  26.     set F_TRAV to 0
  27.   end if
  28.   set SArr to MapHierc(getAt(TWNS, count(TWNS) - 1))
  29.   set GArr to MapHierc(getAt(TWNS, count(TWNS)))
  30.   setAt(SArr, 50, 0)
  31.   setAt(GArr, 50, 0)
  32.   set HIT to 0
  33.   repeat with n = 1 to 18
  34.     repeat with m = 1 to 18
  35.       if getAt(GArr, m) = getAt(SArr, n) then
  36.         set HIT to getAt(SArr, n)
  37.         exit repeat
  38.       end if
  39.     end repeat
  40.     if HIT > 0 then
  41.       exit repeat
  42.     end if
  43.   end repeat
  44.   when timeOut then nothing
  45.   NewDate(J)
  46.   set TT to the ticks + 30
  47.   set PPNM to FixPath(J, PNM & "MAP_DIR:MAP" & string(HIT))
  48.   preLoadCast("FLYBY.AIF")
  49.   repeat while TT > the ticks
  50.   end repeat
  51.   puppetSound("FLYBY.AIF")
  52.   updateStage()
  53.   go("MAP")
  54.   go(the frame + 1)
  55.   sound stop CHN
  56.   go(1, PPNM)
  57. end
  58.